import cls from 'classnames';
import React from 'react';
import { Typography } from '../Typography';
import Style from './index.module.less';
/**
 * 通用文本组件，前后位置有react renderProps，可自定义
 */
export const CommonText = (props) => {
    const { icon, extractIcon, text = '', wrapClassName, style, before, after, onClick, ...args } = props;
    return (<div className={cls(Style.common_text, wrapClassName)} style={style} onClick={onClick}>
      {icon && <div>{icon}</div>}
      {<div>
          {before}
          <Typography {...args}>{text}</Typography>
          {after}
        </div>}
      {extractIcon && <div>{extractIcon}</div>}
    </div>);
};
export default CommonText;
